Fix: Exclude not working with absolute path in some cases (#593)#618
Open
dqkqd wants to merge 1 commit intoKampfkarren:mainfrom
Open
Fix: Exclude not working with absolute path in some cases (#593)#618dqkqd wants to merge 1 commit intoKampfkarren:mainfrom
dqkqd wants to merge 1 commit intoKampfkarren:mainfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #593
Exclude sometimes doesn't work with absolute path because it tries to match the pattern directly with the path itself.
Since the exclude option is relative, the absolute path to lint should be converted to relative path as well.
For example, if we are in
selene-testfolder with the following exclude option:Then, by converting this absolute path
/path/to/selene-test/src/file.luatosrc/file.lua, exclude can work properly.The problem is which path we should relate to, initially I thought using config directory (where
selene.tomllies) is a good place, but to keep it simple without unnecessary changes, I use the current directory (where selene is invoked) instead.